package org.ccay.i18n.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.ccay.core.log.CcayLoggerFactory;
import org.ccay.core.log.ILogger;
import org.ccay.i18n.I18nVO;
import org.ccay.i18n.service.II18nQueryService;

/**
 * 对外的国际化资源查询接口
 */
@Named
public class I18nQueryService implements II18nQueryService {
	
	 private static final ILogger logger = CcayLoggerFactory.getLogger(I18nQueryService.class); 
	 @Inject
	 private I18nResourceBundle resourceBundle;

	 /**
	  * 根据资源 key 语种查询资源对象信息
	  */
	public List<I18nVO> findI18nList(String i18nKey, String i18nLanguage) {
		if(null == i18nKey){
			return resourceBundle.getMergedI18nVO(i18nLanguage);
		}
		List<I18nVO> result = new ArrayList<I18nVO>();
		result.add(resourceBundle.getI18nVO(i18nKey,i18nLanguage));
		return result;
	}

}
